package test.jgroups;

import org.jgroups.JChannel;
import org.jgroups.Message;
import org.jgroups.ReceiverAdapter;

public class Receiver extends ReceiverAdapter {

	public Receiver() {
	}

	@Override
	public void receive(Message msg) {
		System.out.println("Message is : " + msg.toStringAsObject());
	}

	public static void main(String[] args) {
		try {
			String clusterName = "TestJgroups";
			JChannel jChannel = new JChannel();
			jChannel.setReceiver(new Receiver());
			jChannel.connect(clusterName);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
